"ui";
var storage = storages.create("ayjsb");

ui.layout(
    <vertical padding="16">
        <button id="ok" text="开始"/>
        <text text="音量上键停止运行" textSize="40sp" gravity="center"/>
        <checkbox id="Sign_in" checked="true" text="签到"/>
        <checkbox id="Get_notes" checked="true" text="刷领取音符"/>
        <checkbox id="Slide_video" checked="true" text="刷视频"/>
    </vertical>
);

ui.Sign_in.on("check", (checked)=>{
    if(checked){
        toast("签到被勾选了");
    }else{
        toast("签到被取消勾选了");
    }
});

ui.Get_notes.on("check", (checked)=>{
    if(checked){
        toast("刷领取音符被勾选了");
    }else{
        toast("刷领取音符被取消勾选了");
    }
});

ui.Slide_video.on("check", (checked)=>{
    if(checked){
        toast("刷视频被勾选了");
    }else{
        toast("刷视频被取消勾选了");
    }
});

// 指定确定按钮点击时要执行的动作
ui.ok.click(function(){
    // 通过getText()获取输入的内容
    // toast("开始辣");
    var Sign_in = ui.Sign_in.checked;
    var Get_notes = ui.Get_notes.checked;
    var Slide_video = ui.Slide_video.checked;

    storage.put("Sign_in", Sign_in);
    storage.put("Get_notes", Get_notes);
    storage.put("Slide_video", Slide_video);

    var path = 'ayjsb.js'
    execution = engines.execScriptFile(path);
});
